package main

import (
	"fmt"
	"sync"
)

func main() {
	wg := sync.WaitGroup{}
	wg.Add(10) //增加异步数量

	for i := 0; i < 10; i++ {
		go func(a, b int) { //开启N个子协程
			defer wg.Done() //减1
			//to do
			fmt.Println(a + b)
		}(1, 10)
	}

	wg.Wait() //等待减为0
}
